import React, {Component} from 'react'
import Search from './components/Search';

import List from './components/List';

export default class App extends Component {

    state = {
        users: [],       // 请求得到的用户数据
        isFirst: true,
        isLoading: false,
        err: ''
    }
    //
    saveUsers = (users) => {
        this.setState({users});
    }

    updateAppState = (stateObj) => {
        this.setState(stateObj);
    }

    render() {
        return (
            <div className="container">
                <Search updateAppState={this.updateAppState} />
                <List {...this.state} />
            </div>
        )
    }
}
